#include<iostream>
using namespace std;
class CVector
{
private:
    int* data;
    int n;
public:
    CVector()
    {
        n = 5;
        data = new int[n];
        for (int i = 0; i < n; i++)
        {
            data[i] = i;
        }
    }
    CVector(int n1, int* a)
    {
        data = new int[n1];
        n = n1;
        for (int i = 0; i < n1; i++)
        {
            data[i] = a[i];
        }
    }
    void Print()
    {
        for (int i = 0; i < n; i++)
        {
            if (i != 0)
                cout << " ";
            cout << data[i];
        }
        cout << endl;
    }
    ~CVector()
    {
        if (data)
            delete[] data;
    }

    friend CVector add(const CVector v1, const CVector v2)
    {
        CVector ans(v1);
        for (int i = 0; i < v2.n; i++)
        {
            ans.data[i] += v2.data[i];
        }
        return ans;
    }

    CVector(const CVector& tmp)
    {
        n = tmp.n;
        data = new int[n];
        for (int i = 0; i < n; i++)
        {
            data[i] = tmp.data[i];
        }
    }

};

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int N;
        cin >> N;
        int* a1 = new int[N];
        int* a2 = new int[N];
        for (int i = 0; i < N; i++)
        {
            cin >> a1[i];
        }
        for (int i = 0; i < N; i++)
        {
            cin >> a2[i];
        }
        CVector tma(N, a1);
        tma.Print();
        CVector tmb(N, a2);
        tmb.Print();
        add(tma, tmb).Print();
        delete[] a1;
        delete[] a2;
    }
}